<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>

</head>
<body>

<table class="table">
    <thead>
    <tr>
        <th scope="col">id</th>
        <th scope="col">类型</th>
        <th scope="col">日期</th>
        <th scope="col">开始时间</th>
        <th scope="col">结束时间</th>
        <th scope="col">重复</th>
        <th scope="col">座位列表</th>
        <th scope="col">用户名</th>
        <th scope="col">密码</th>
        <th scope="col">邮箱</th>
    </tr>
    </thead>
    <tbody>
    <tr id="list">

    </tr>
    </tbody>
</table>


<script>
    $.ajax({
        type: "GET",
        url: "./task/all",
        data: content,
        success:function (message) {
            //alert("提交成功"+JSON.stringify(message));
            let json = JSON.parse(message);
            let data = json['data'];
            for (let i=0; i<data.length; i++) {
                alert(data[i]);

                let line =
                    `<td>${data[i]["id"]}</td>
        <td>${data[i]["type"]}</td>
        <td>${data[i]["date"]}</td>
        <td>${data[i]["startTime"]}</td>
        <td>${data[i]["endTime"]}</td>
        <td>${data[i]["repeatInfo"]}</td>
        <td>${data[i]["seatNums"]}</td>
        <td>${data[i]["usernames"]}</td>
        <td>${data[i]["passwords"]}</td>
        <td>${data[i]["emails"]}</td>`;
                $('#list').append(line);
            }
        },
        error:function (message) {
            alert("提交失败"+JSON.stringify(message));
        }
    });
</script>
</body>
</html>